﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Koonsoft.HYCRM.BLL;

public partial class Report_DailySheet : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            StartTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            EndTime.Text = DateTime.Now.ToString("yyyy-MM-dd");

            BindData();
        }
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        BindData();
    }

    private void BindData()
    {
        GridView1.DataSource = new OrderBLL().GetDailySheet(DropDownList1.SelectedValue, StartTime.Text.Trim(),
                                                                   EndTime.Text.Trim(), DropDownList2.SelectedValue, DropDownList3.SelectedValue, 
                                                                   Convert.ToInt32(DropDownList4.SelectedValue));
        GridView1.DataBind();
    }
}